package com.lagou.ipersistence.mapping;

import com.lagou.ipersistence.session.Configuration;
import com.lagou.ipersistence.type.JdbcType;
import com.lagou.ipersistence.type.TypeHandler;

/**
 * @author Yan Jiahong
 * Created on 2020/11/21
 */
public class ResultMapping {
    private Configuration configuration;
    private String property;
    private String column;
    private Class<?> javaType;
    private JdbcType jdbcType;
    private TypeHandler<?> typeHandler;
    private boolean lazy;
    
    ResultMapping() {
    }
    
    public static class Builder {
        ResultMapping resultMapping = new ResultMapping();
        
        public Builder(Configuration configuration, String property, String column, TypeHandler<?> typeHandler) {
            this(configuration, property);
            resultMapping.column = column;
            resultMapping.typeHandler = typeHandler;
        }
        
        public Builder(Configuration configuration, String property, String column, Class<?> javaType) {
            this(configuration, property);
            resultMapping.column = column;
            resultMapping.javaType = javaType;
        }
        
        public Builder(Configuration configuration, String property) {
            resultMapping.configuration = configuration;
            resultMapping.property = property;
        }
    }
}
